<?php /* Smarty version 2.6.18, created on 2016-12-14 13:27:45
         compiled from score/score.subject.tpl.php */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
      <!--树状图-->
        <section class="col-lg-2 connectedSortable" style="padding-right:0;">
         <div class="sidebar" style="background-color:#fff; padding-bottom:0px;">
             <ul class="sidebar-menu" id="chan">
					<?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                    <li class="treeview <?php if ($this->_tpl_vars['key'] == $this->_tpl_vars['class_data']['grade_id']): ?>active<?php endif; ?>" >
                      <a href="#">
                        <i class="glyphicon glyphicon-align-left"></i> <span><?php echo $this->_tpl_vars['value']['grade_name']; ?>
</span> <i class="fa fa-angle-left pull-right"></i>
                      </a>
                          <ul class="treeview-menu" style="background-color:#fff;">
							<?php $_from = $this->_tpl_vars['value']['class']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
                            <li <?php if ($this->_tpl_vars['v']['class_id'] == $this->_tpl_vars['class_data']['class_id']): ?>class="active"<?php endif; ?>><a href="index.php?a=score.subject&class_id=<?php echo $this->_tpl_vars['v']['class_id']; ?>
"><i class="fa fa-angle-right"></i>  <?php echo $this->_tpl_vars['v']['class_name']; ?>
</a></li>
							<?php endforeach; endif; unset($_from); ?>
                          </ul>
                     </li>
					<?php endforeach; endif; unset($_from); ?>
              </ul>
            </div>
        </section>
        <!--树状图结束-->
        <section class="col-lg-10 connectedSortable">
         <div class="box box-default box-solid">
             <form action="" method="post">	
                <div class="box-header with-border">
                    <span class="fa fa-edit (alias)" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title"><?php echo $this->_tpl_vars['class_data']['class_name']; ?>
成绩统计科目设置（配置好一个班级后可复制给其他班级）</p>
                </div>
                <div class="box-body">
                      <div class="form-group">
						  <label class="col-md-2 text-right">
							   综合科目设置：
						  </label>
						  <div class="input-group col-md-6 col-sm-12 col-xs-12">
							   <span class="btn btn-default btn-sm" data-toggle="modal" data-target="#myModal">添 加</span>
                               <span class="text-info">非必要可不设置</span>
						  </div> 
				      </div>
                      <p class="col-md-offset-2" id="summary">
							   <?php $_from = $this->_tpl_vars['set']['score_group']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
							   <?php echo $this->_tpl_vars['key']; ?>
: <?php echo $this->_tpl_vars['value']; ?>
 <a onclick="if(confirm('警告！确认删除信息?')==false)return false;" href="index.php?a=score.groupdel&class_id=<?php echo $this->_tpl_vars['class_data']['class_id']; ?>
&group_name=<?php echo $this->_tpl_vars['key']; ?>
">删除</a><br/>
							   <?php endforeach; endif; unset($_from); ?>
					 </p>
                      
                      <div class="form-group" style="margin-bottom:6px;">
						  <label class="col-md-2 text-right" style="padding-left:0;">
							   计入总分的学科：
						  </label>
						  <div class="input-group col-sm-10 col-xs-12">
						  <?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
							    <label class="choice"><input type="checkbox" name="score_total[]" value="<?php echo $this->_tpl_vars['value']['subject_id']; ?>
" <?php if ($this->_tpl_vars['value']['is_total'] == '1'): ?>checked<?php endif; ?>> <?php echo $this->_tpl_vars['value']['subject_name']; ?>
</label>
						  <?php endforeach; endif; unset($_from); ?>
						  </div> 
				      </div> 
                      <p class="col-md-offset-2 text-info">说明：没计入总分的学科可单独录入成绩，只是不参加总分累加。</p> 
                       <div class="form-group">
						  <label class="col-md-2 text-right">
							   报表顺序设置：
						  </label>
						  <div class="col-md-10 col-sm-12 col-xs-12">
                               <div style="width:100%; overflow-x:scroll;">
                                   <table class="table table-bordered">
                                       <tr>
								   <?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                           <td><?php echo $this->_tpl_vars['value']['subject_name']; ?>
</td>
									<?php endforeach; endif; unset($_from); ?>
                                           <?php $_from = $this->_tpl_vars['set']['score_group']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                           <td><?php echo $this->_tpl_vars['key']; ?>
</td>
                                           <?php endforeach; endif; unset($_from); ?>
                                       </tr>
                                       <tr> 
								   <?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                                           <td><input type="text" name="score_order_<?php echo $this->_tpl_vars['value']['subject_id']; ?>
" value="<?php echo $this->_tpl_vars['value']['score_order']; ?>
" size="4"></td>
									<?php endforeach; endif; unset($_from); ?>
								   <?php $_from = $this->_tpl_vars['group_order']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
								   <td><input type="text" name="score_order_<?php echo $this->_tpl_vars['key']; ?>
" value="<?php echo $this->_tpl_vars['value']; ?>
" size="4"></td>
								   <?php endforeach; endif; unset($_from); ?>
                                       </tr>
                                   </table>
                               </div>
						  </div> 
				      </div> 
                      <div class="form-group" style="margin-bottom:6px;">
						  <label class="col-md-2 text-right" style="padding-left:0;">
							   选择复制班级：
						  </label>
						  <div class="col-md-10 col-sm-10 col-xs-12">
							       <ul id="treeDemo" class="ztree"></ul>
                                   <div style="display:none;">
                                        被勾选时：<input type="checkbox" id="py" class="checkbox first" checked /><span>关联父</span>
                                        <input type="checkbox" id="sy" class="checkbox first" checked /><span>关联子</span><br/>
                                        取消勾选时：<input type="checkbox" id="pn" class="checkbox first" checked /><span>关联父</span>
                                        <input type="checkbox" id="sn" class="checkbox first" checked /><span>关联子</span><br/>
                                    </div>
                          </div> 
                      </div> 
				</div><!--box-body -->
						<div id="hiddenBox"></div>
                <div class="box-footer text-center">
                    <button type="submit" class="btn btn-primary " onclick="c();">  保 存</button>
                </div>
              </form>
           </div><!--box box-default box-solid-->
         </section>   
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<!--弹出层-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <form name="form2" action="index.php?a=score.groupadd" method="post" id="dlg_form">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">综合科目设置</h4>
      </div>
      <div class="modal-body">
             <div class="form-group">
                      <label class="col-md-3 text-right">
                           综合科目名称：
                      </label>
                      <div class="input-group col-sm-9 col-xs-12">
                            <input type="text" value="" name="group_name">
                      </div> 
			</div> 
            <div class="form-group" style="margin-bottom:6px;">
                  <label class="col-md-3 text-right">
                       包含学科：
                  </label>
                  <div class="input-group col-sm-9 col-xs-12">
				  <?php $_from = $this->_tpl_vars['subject_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
                        <label class="choice"><input type="checkbox" name="score_group[]" value="<?php echo $this->_tpl_vars['value']['subject_id']; ?>
"> <?php echo $this->_tpl_vars['value']['subject_name']; ?>
</label>
				  <?php endforeach; endif; unset($_from); ?>
                  </div> 
             </div>    
      </div>
      <div class="modal-footer">
		<input type="hidden" name="class_id" value="<?php echo $this->_tpl_vars['class_data']['class_id']; ?>
">
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="submit" class="btn btn-primary">确定</button>
      </div>
    </div>
    </form>
  </div>
</div>
<!--弹出层-->
<!-- jQuery 2.2.0 -->

<script type="text/javascript" src="static/js/jquery.ztree.core.js"></script><!--树形-->
<script type="text/javascript" src="static/js/jquery.ztree.excheck.js"></script><!--树形-->
<script type="text/javascript">
		var setting = {
			check: {
				enable: true,	
			},
			data: {
				simpleData: {
					enable: true
				}
			}
		};
		var zNodes =[
		<?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
			{ id:"g<?php echo $this->_tpl_vars['key']; ?>
", pId:0, name:"<?php echo $this->_tpl_vars['value']['grade_name']; ?>
",},
			<?php $_from = $this->_tpl_vars['value']['class']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['k'] => $this->_tpl_vars['v']):
?>
			{ id:"c<?php echo $this->_tpl_vars['v']['class_id']; ?>
", pId:"g<?php echo $this->_tpl_vars['key']; ?>
", name:"<?php echo $this->_tpl_vars['v']['class_name']; ?>
",},
			<?php endforeach; endif; unset($_from); ?>
		<?php endforeach; endif; unset($_from); ?>
		];
		var code;
		
		function setCheck() {
			var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
			py = $("#py").attr("checked")? "p":"",
			sy = $("#sy").attr("checked")? "s":"",
			pn = $("#pn").attr("checked")? "p":"",
			sn = $("#sn").attr("checked")? "s":"",
			type = { "Y":py + sy, "N":pn + sn};
			zTree.setting.check.chkboxType = type;
			showCode('setting.check.chkboxType = { "Y" : "' + type.Y + '", "N" : "' + type.N + '" };');
		}
		function showCode(str) {
			if (!code) code = $("#code");
			code.empty();
			code.append("<li>"+str+"</li>");
		}
		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
			setCheck();
			$("#py").bind("change", setCheck);
			$("#sy").bind("change", setCheck);
			$("#pn").bind("change", setCheck);
			$("#sn").bind("change", setCheck);
		});
function c()
{
	var delidID = "";
	var zTree = $.fn.zTree.getZTreeObj("treeDemo").getCheckedNodes(true);//获取所有选中状态的节点  
	for (var i = 0; i < zTree.length; i++) {  
		//delidID += zTree[i].id + ",";
		$("#hiddenBox").append('<input type="hidden" name="to_class[]" value="'+zTree[i].id+'">');
	}

} 	
</script>